package main

import (
	"fmt"
	"log"
	"net/http"
)

type Hello struct{}

func (h Hello) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	fmt.Fprint(w, "Hello!")
}

func main() {
	var h Hello
	err := http.ListenAndServe("127.0.0.1:80", h) //4000 端口不能执行 提示：bind：only one usage of each socket address (protocol/network address/port) is normally permitted
	if err != nil {
		fmt.Printf("error exit\n")
		log.Fatal(err)
	}
}
